const Mock=require('mockjs')



Mock.mock('/login',"post",function (options) {
    //解析参数
    var params=JSON.parse(options.body)
    var {user,password}=params
    // 判断
    if(user==="aaa"&&password==="12345"){
        return{
            code:200,
            msg:"登陆成功",
           token:Mock.Random.word()
        }
    }else{
        return{
            code:400,msg:"登陆失败"
        }
    }
})